<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>找出一个整数数组中第 K 大的整数</title>
</head>

<body>
  <script>
    function Number(nums, k) {
      nums.sort((a, b) => {
        if (a.length > b.length) {
          return -1
        }
        if (a.length < b.length) {
          return 1
        } else {
          if (a >= b) return -1
          else return 1
        }
      })
      return nums[k - 1]
    };
    console.log(Number(["3", "6", "7", "10"], 4));
  </script>
</body>

</html>